Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

resolve-package-path

Package Overview
Dependencies
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

resolve-package-path

a special purpose fast memoizing way to resolve a node modules package.json

  • 1.2.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.3M
increased by3.31%
Maintainers
2
Weekly downloads
 
Created

What is resolve-package-path?

The resolve-package-path npm package is used to resolve the path of a package in the node_modules directory. It helps in finding the exact location of a package, which can be useful for various purposes such as loading configurations, plugins, or dependencies dynamically.

What are resolve-package-path's main functionalities?

Resolve package path

This feature allows you to resolve the path of a given package from the node_modules directory. In this example, it resolves the path of the 'express' package from the current working directory.

const resolvePackagePath = require('resolve-package-path');
const packagePath = resolvePackagePath('express', process.cwd());
console.log(packagePath);

Resolve package path with custom base directory

This feature allows you to resolve the path of a package from a custom base directory. In this example, it resolves the path of the 'express' package from a specified custom base directory.

const resolvePackagePath = require('resolve-package-path');
const packagePath = resolvePackagePath('express', '/path/to/custom/base/directory');
console.log(packagePath);

Resolve package path with cache

This feature allows you to resolve the path of a package with caching. The cache helps in improving performance by storing previously resolved paths. In this example, it resolves the path of the 'express' package with a cache.

const resolvePackagePath = require('resolve-package-path');
const cache = new Map();
const packagePath = resolvePackagePath('express', process.cwd(), cache);
console.log(packagePath);

Other packages similar to resolve-package-path

FAQs

Package last updated on 16 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc